package io.genezhao.mybatisplus.mvc.controller;


import com.baomidou.mybatisplus.plugins.Page;
import io.genezhao.mybatisplus.mvc.entity.User;
import io.genezhao.mybatisplus.mvc.service.UserService;
import io.genezhao.mybatisplus.mvc.vo.UserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author genezhao
 * @since 2018-06-12
 */
@RestController
@RequestMapping("/user")
public class UserController {


    @Autowired
    private UserService userService;

    @PostMapping("/page")
    public Page<User> selectUserPage(@RequestBody UserVo param) {
        return userService.selectUserPage(param.getCurrentPage(), param.getPageSize(), param);
    }
}

